Evaluation of oyster exposure experiments
knitr::opts_chunk$set(echo = TRUE, warning = F, message = F, fig.path = 'figs/', dev.args = list(family = 'serif'))
library(tidyverse)
library(patchwork)
library(ggbeeswarm)
library(psycho)
library(lmerTest)
library(hrbrthemes)
library(kableExtra)
library(shiny)
source('R/funcs.R')
data(allexp)
data(bymods)
data(wtmods)
Number of folds
Raw data
yvar <- 'Number of folds'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.63 |
0.16 |
4 |
25.69 |
9.92 |
0.00 |
| week |
0.01 |
0.01 |
2 |
24.16 |
0.42 |
0.66 |
| trt:week |
0.07 |
0.01 |
8 |
25.46 |
0.58 |
0.79 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.73 |
0.18 |
4 |
31.25 |
9.19 |
0.00 |
| week |
0.01 |
0.01 |
2 |
30.19 |
0.36 |
0.70 |
| trt:week |
0.23 |
0.03 |
8 |
31.05 |
1.42 |
0.23 |
dat %>%
pull(plomod)

Number of irregularites
Raw data
yvar <- 'Number of irregularities'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.38 |
0.10 |
4 |
26.01 |
2.24 |
0.09 |
| week |
0.07 |
0.03 |
2 |
23.62 |
0.80 |
0.46 |
| trt:week |
0.53 |
0.07 |
8 |
26.22 |
1.54 |
0.19 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.70 |
0.18 |
4 |
27.51 |
6.08 |
0.00 |
| week |
0.03 |
0.02 |
2 |
26.70 |
0.53 |
0.60 |
| trt:week |
0.78 |
0.10 |
8 |
27.19 |
3.40 |
0.01 |
dat %>%
pull(plomod)

Total observations (dissolution)
Raw data
yvar <- 'Total observations'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
1.42 |
0.36 |
4 |
31.93 |
1.48 |
0.23 |
| week |
0.16 |
0.08 |
2 |
29.77 |
0.33 |
0.72 |
| trt:week |
2.37 |
0.30 |
8 |
31.83 |
1.23 |
0.31 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
1.87 |
0.47 |
4 |
28.70 |
1.40 |
0.26 |
| week |
2.71 |
1.36 |
2 |
27.63 |
4.07 |
0.03 |
| trt:week |
4.51 |
0.56 |
8 |
28.56 |
1.69 |
0.14 |
dat %>%
pull(plomod)

Dissolution score
Raw data
yvar <- 'Dissolution score (0-3)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
4.78 |
1.19 |
4 |
28.14 |
10.96 |
0.00 |
| week |
0.05 |
0.02 |
2 |
26.69 |
0.22 |
0.81 |
| trt:week |
1.37 |
0.17 |
8 |
27.81 |
1.58 |
0.18 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
3.30 |
0.82 |
4 |
27.73 |
10.76 |
0.00 |
| week |
0.15 |
0.07 |
2 |
26.72 |
0.97 |
0.39 |
| trt:week |
0.49 |
0.06 |
8 |
27.56 |
0.80 |
0.61 |
dat %>%
pull(plomod)

Length
Raw data
yvar <- 'Length (cm)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.14 |
0.03 |
4 |
60.79 |
0.43 |
0.79 |
| week |
0.02 |
0.01 |
2 |
60.79 |
0.11 |
0.89 |
| trt:week |
0.42 |
0.05 |
8 |
60.78 |
0.66 |
0.72 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.09 |
0.02 |
4 |
58.08 |
0.30 |
0.88 |
| week |
0.09 |
0.05 |
2 |
58.08 |
0.60 |
0.55 |
| trt:week |
0.58 |
0.07 |
8 |
58.08 |
0.93 |
0.50 |
dat %>%
pull(plomod)

Width
Raw data
yvar <- 'Width (cm)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.26 |
0.06 |
4 |
60.19 |
1.11 |
0.36 |
| week |
0.04 |
0.02 |
2 |
60.19 |
0.35 |
0.70 |
| trt:week |
0.31 |
0.04 |
8 |
60.19 |
0.68 |
0.71 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.03 |
0.01 |
4 |
58.08 |
0.15 |
0.96 |
| week |
0.07 |
0.03 |
2 |
58.08 |
0.75 |
0.48 |
| trt:week |
0.26 |
0.03 |
8 |
58.08 |
0.73 |
0.67 |
dat %>%
pull(plomod)

Shell weight
Raw data
yvar <- 'Shell weight (g)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.05 |
0.01 |
4 |
50.58 |
0.34 |
0.85 |
| week |
0.09 |
0.05 |
2 |
51.98 |
1.23 |
0.30 |
| trt:week |
0.27 |
0.03 |
8 |
52.01 |
0.90 |
0.52 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.06 |
0.01 |
4 |
43.46 |
1.44 |
0.24 |
| week |
0.03 |
0.01 |
2 |
43.60 |
1.34 |
0.27 |
| trt:week |
0.11 |
0.01 |
8 |
43.61 |
1.39 |
0.23 |
dat %>%
pull(plomod)

Tissue weight
Raw data
yvar <- 'Tissue weight (g)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.00 |
0 |
4 |
51.28 |
0.62 |
0.65 |
| week |
0.00 |
0 |
2 |
52.70 |
1.23 |
0.30 |
| trt:week |
0.01 |
0 |
8 |
52.73 |
0.68 |
0.71 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
0.00 |
0 |
4 |
41.32 |
0.87 |
0.49 |
| week |
0.00 |
0 |
2 |
41.46 |
0.92 |
0.41 |
| trt:week |
0.01 |
0 |
8 |
41.48 |
1.32 |
0.26 |
dat %>%
pull(plomod)

Whole weight
Raw data
yvar <- 'Whole weight (g)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Df |
Deviance |
Resid. Df |
Resid. Dev |
| NULL |
NA |
NA |
286 |
21.97 |
| trt |
4 |
0.64 |
282 |
21.33 |
| week |
2 |
0.92 |
280 |
20.41 |
| trt:week |
8 |
1.03 |
272 |
19.38 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Df |
Deviance |
Resid. Df |
Resid. Dev |
| NULL |
NA |
NA |
275 |
7.04 |
| trt |
4 |
0.15 |
271 |
6.90 |
| week |
2 |
0.15 |
269 |
6.75 |
| trt:week |
8 |
1.20 |
261 |
5.54 |
dat %>%
pull(plomod)

Respiration
Raw data
yvar <- 'Respiration (umol/hr/g)'
toplo <- allexp %>%
filter(var %in% yvar)
p <- ggplot(toplo, aes(x = factor(week), y = val, colour = species, fill = species)) +
geom_boxplot(outlier.shape = NA, alpha = 0.1) +
geom_point(aes(group = species), position = position_jitterdodge(jitter.width = 0.1), size = 2, alpha = 0.6) +
theme_ipsum_rc() +
facet_grid(trt~ .) +
scale_colour_ipsum() +
scale_fill_ipsum() +
theme(legend.title = element_blank()) +
labs(x = 'Exposure week', y = yvar)
p

Models with week
Olympia oyster
dat <- wtmods %>%
filter(species == 'Olympia') %>%
filter(var == yvar)
dat %>%
filter(species == 'Olympia') %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
13.93 |
3.48 |
4 |
44.51 |
0.29 |
0.88 |
| week |
10.23 |
5.12 |
2 |
46.96 |
0.42 |
0.66 |
| trt:week |
64.95 |
8.12 |
8 |
47.14 |
0.67 |
0.72 |
dat %>%
pull(plomod)

Pacific oyster
dat <- wtmods %>%
filter(species == 'Pacific') %>%
filter(var == yvar)
dat %>%
pull(anomod) %>%
.[[1]] %>%
knitr::kable(format = 'html', digits = 2) %>%
kable_styling(full_width = T, font_size = 14) %>%
HTML
| |
Sum Sq |
Mean Sq |
NumDF |
DenDF |
F value |
Pr(>F) |
| trt |
37.54 |
9.39 |
4 |
45.50 |
0.69 |
0.61 |
| week |
9.84 |
4.92 |
2 |
44.45 |
0.36 |
0.70 |
| trt:week |
54.96 |
6.87 |
8 |
45.48 |
0.50 |
0.85 |
dat %>%
pull(plomod)
